home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2321 < prev    next >
Encoding:
Internet Message Format  |  1996-08-06  |  1.1 KB

  1. Path: oxy.rust.net!usenet
  2. From: ebennett@rust.net
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Using a Base constructor for a derived class
  5. Date: Wed, 17 Jan 1996 05:58:16 GMT
  6. Organization: Rust Net - High Speed Internet in Detroit  810-642-2276
  7. Message-ID: <4dhoio$ioj@oxy.rust.net>
  8. References: <4ddui9$a14@felix.cc.gatech.edu>
  9. NNTP-Posting-Host: liv-10.rust.net
  10. X-Newsreader: Forte Free Agent 1.0.82
  11.  
  12. culbreth@cc.gatech.edu (Matthew W. Culbreth) wrote:
  13.  
  14. >Howdy,
  15.  
  16. >I have a base class with a constructor.  This class is never used
  17. >in my application.  I have three classes derived from this class.
  18.  
  19. >When I create an instant of one of the derived class, I want to use the 
  20. >constructor from the base class.  The compiler is stating that it can't find 
  21. >the constructor for the arguments passed for any of the derived classes.
  22. >Are constructors inherited the same as member functions?
  23.  
  24. No, constructors are not virtual.  If you want to create an instance
  25. of a derived class passing arguments, then you must define a
  26. constructor in the derived class which expects those arguments.
  27.  
  28. Earl
  29.  
  30.  
  31.